import { logger } from "../logger";
import * as vscode from 'vscode';
import * as path from 'path';
import { PushFileToDevicePanel } from "./pushFileToDevicePanel";

export function pushFileToDevice(args: any[], context: vscode.ExtensionContext) {
    const parentFolderName = args[0];
    const path = args[1];


    PushFileToDevicePanel.createOrShow(context.extensionUri);

    return;

    vscode.window.withProgress({
        location: vscode.ProgressLocation.Notification,
        title: `Begin to push file to device...`,
        cancellable: true
    },
    async (progress, token) => {
        for (let i = 0; i < 10; i++) {
            if (token.isCancellationRequested) {
                return;
            }
            await new Promise(resolve => setTimeout(resolve, 1000));
            progress.report({ increment: i * 10 });
        }
        
        // Return a value to signal completion of the progress operation
        return true;
    }).then(completed => {
        if (completed) {
            // Show success message with a button after progress is complete
            vscode.window.showInformationMessage(
                `Restart Device`,
                'Restart','Ignore'
            ).then(selection => {
                // Handle button click
                if (selection === 'Restart') {
                    vscode.window.showInformationMessage(`Begin Restart Device...`);
                }
            });
        }
    });
}